#!/bin/bash 
for ip in `cat /home/myhosts/ip.txt`
do
if  grep -q -w $ip /etc/hosts; then
	
	echo $ip has been added!
else
	echo `nslookup -q=AAAA $ip 2001:778::37 | awk -F "address" 'NR==5 {print $2}' | sed '/^$/d' |
	sed 's/^[ ]*//g' ` $ip  | tee -a  /etc/hosts
fi
done
